﻿// Decompiled with JetBrains decompiler
// Type: YJM_PTO.Form2
// Assembly: YJM_PTO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 17EE8669-AD07-48C9-A340-87C7401F98C3
// Assembly location: C:\Users\Administrator\Desktop\bin\YJM_PTO.exe

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Management;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using System.Xml;


namespace YJM_PTO
{
    public class Form2 : Form
    {
        private string[] CusArray;
        private IContainer components = (IContainer)null;
        private Button button1;
        private TextBox txtQryInfo;
        private Label label2;
        private Button bntQryCus;
        private Panel panel1;
        private Panel panel2;
        private DataGridView dgvCusList;
        private DataGridViewTextBoxColumn Column1;
        private DataGridViewTextBoxColumn CodeNo;
        private DataGridViewTextBoxColumn CusName;
        private DataGridViewTextBoxColumn dName;
        private Panel panel3;
        private Label lblCusInfo;
        private Label label3;
        private Panel panel4;
        private TextBox txtCorpOrderID;
        private Label label6;
        private TextBox txtActor;
        private Label label5;
        private Label label4;
        private TextBox txtProdFilePath;
        private Label label1;
        private Button SelectFile;
        private GroupBox groupBox1;
        private DataGridView dgvPtOList;
        private DateTimePicker dateTimePicker1;
        private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
        private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
        private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
        private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
        private DataGridViewTextBoxColumn Column2;
        private Label label7;
        private Label label8;
        private CheckBox cbPL;
        private ComboBox cbbOutType;
        private Label label9;
        private CheckBox cbDHY;
        private DataGridViewTextBoxColumn Column3;

        public Form2() => this.InitializeComponent();

        private void Form2_Load(object sender, EventArgs e)
        {
            this.LoadFile();
            this.LoadOutType();
        }

        private void SelectFile_Click(object sender, EventArgs e)
        {
            this.txtProdFilePath.Text = "";
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            openFileDialog1.Filter = "Files(*.xml) | *.xml";
            OpenFileDialog openFileDialog2 = openFileDialog1;
            if (this.cbPL.Checked||cbDHY.Checked)
                openFileDialog2.Multiselect = true;
            if (openFileDialog2.ShowDialog() != DialogResult.OK)
                return;
            this.txtProdFilePath.Text = string.Join(";", openFileDialog2.FileNames);
        }

        public void LoadOutType()
        {
            this.cbbOutType.ItemHeight = 20;
            this.cbbOutType.DrawMode = DrawMode.OwnerDrawVariable;
            Cursor.Current = Cursors.WaitCursor;
            string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "OutModel" + "\\WareHouseOutType.txt";
            if (!File.Exists(path))
                return;
            StreamReader streamReader = new StreamReader((Stream)File.Open(path, FileMode.Open), Encoding.GetEncoding("GB2312"));
            ArrayList arrayList = new ArrayList();
            this.cbbOutType.Items.Clear();
            string str = streamReader.ReadToEnd().Replace("\r\n", "\n");
            streamReader.Close();
            streamReader.Dispose();
            this.cbbOutType.Items.AddRange((object[])str.Split('\n'));
            if (this.cbbOutType.Items.Count > 0)
                this.cbbOutType.SelectedIndex = 0;
            Cursor.Current = Cursors.Default;
        }

        private void cbbOutType_DrawItem(object sender, DrawItemEventArgs e)
        {
            if (e.Index < 0)
                return;
            e.DrawBackground();
            e.DrawFocusRectangle();
            Graphics graphics = e.Graphics;
            string s = this.cbbOutType.Items[e.Index].ToString();
            Font font = e.Font;
            SolidBrush solidBrush = new SolidBrush(e.ForeColor);
            Rectangle bounds = e.Bounds;
            double x = (double)bounds.X;
            bounds = e.Bounds;
            double y = (double)(bounds.Y + 3);
            graphics.DrawString(s, font, (Brush)solidBrush, (float)x, (float)y);
        }

        public void LoadCus()
        {
            Cursor.Current = Cursors.WaitCursor;
            string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "CusFile" + "\\Customers.txt";
            if (!File.Exists(path))
                return;
            this.dgvCusList.Rows.Clear();
            StreamReader streamReader = new StreamReader((Stream)File.Open(path, FileMode.Open), Encoding.GetEncoding("GB2312"));
            ArrayList arrayList = new ArrayList();
            Thread.Sleep(1);
            this.CusArray = streamReader.ReadToEnd().Replace("\r\n", "\n").Split('\n');
            streamReader.Close();
            streamReader.Dispose();
            Cursor.Current = Cursors.Default;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string sysTime = this.GetSysTime();
            if (sysTime == "")
            {
                int num1 = (int)MessageBox.Show("软件暂未注册，无法使用转换功能，请联系供应商。");
            }
            else
            {
                string s = DateTime.Now.ToString("yyyyMMdd");
                if (sysTime != "zk" && !int.TryParse(sysTime, out int _))
                {
                    int num2 = (int)MessageBox.Show("软件注册时间存在问题[" + sysTime + "]，请联系供应商。");
                }
                else if (sysTime != "zk" && int.Parse(sysTime) < int.Parse(s))
                {
                    int num3 = (int)MessageBox.Show("软件注册已到期，到期时间[" + sysTime + "]，请联系供应商。");
                }
                else
                {
                    string str1 = this.lblCusInfo.Text.Trim() == "暂未选择" ? "" : this.lblCusInfo.Text.Trim();
                    string str2 = this.dateTimePicker1.Value.ToString("yyyy-MM-dd HH:mm:ss");
                    string str3 = this.txtActor.Text.Trim();
                    string str4 = this.txtCorpOrderID.Text.Trim();
                    string[] source = this.txtProdFilePath.Text.Trim().Split(';');
                    string str5 = this.cbbOutType.Text.Trim();
                    if (string.IsNullOrEmpty(str1))
                    {
                        int num4 = (int)MessageBox.Show("未选择客户信息！");
                    }
                    else if (string.IsNullOrEmpty(this.txtProdFilePath.Text.Trim()))
                    {
                        int num5 = (int)MessageBox.Show("请先选择生产文件！");
                    }
                    else if (string.IsNullOrEmpty(str2))
                    {
                        int num6 = (int)MessageBox.Show("未选择出库时间！");
                    }
                    else if (string.IsNullOrEmpty(str3))
                    {
                        int num7 = (int)MessageBox.Show("操作员不能未空！");
                    }
                    else if (string.IsNullOrEmpty(str4))
                    {
                        int num8 = (int)MessageBox.Show("出库单不能未空！");
                    }
                    else if (string.IsNullOrEmpty(str5))
                    {
                        int num9 = (int)MessageBox.Show("出库类型不能为空！");
                    }
                    else
                    {
                        Cursor.Current = Cursors.WaitCursor;

                        if (cbDHY.Checked)//多合一转换
                        {
                            ManyInOne(str1, str2, str3, str4, str5, source);
                        }
                        else
                        {
                            string outType = str5.Split(':')[0];
                            string str6 = str5.Split(':')[1];
                            string str7 = str1.Split(',')[0];
                            string filename = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "OutModel\\out.xml";
                            string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "ProdToOutBatch\\" + DateTime.Now.ToString("yyMMddHHmmss");
                            int index = 0;
                            foreach (string sourcePath in source)
                            {
                                string billNo = str4;
                                if (source.Count() != 1)
                                {
                                    index = index + 1;
                                    billNo = $"{billNo}_{index}";
                                }
                                string str8 = this.SaveProdFile(outType, billNo, sourcePath);
                                XmlDocument xmlDocument = new XmlDocument();
                                xmlDocument.Load(str8);
                                XmlNode documentElement1 = (XmlNode)xmlDocument.DocumentElement;
                                int num10 = documentElement1.SelectSingleNode("Events/Event/Relation").Attributes["cascade"].InnerText.Count<char>((Func<char, bool>)(ch => ch == ':')) + 1;

                                List<string> stringList = new List<string>();
                                foreach (XmlNode selectNode1 in documentElement1.SelectNodes("Events/Event/Relation/Batch"))
                                {
                                    foreach (XmlNode selectNode2 in selectNode1.SelectNodes("Code"))
                                    {
                                        string innerText1 = selectNode2.Attributes["packLayer"].InnerText;
                                        if (num10.ToString() == innerText1)
                                        {
                                            string innerText2 = selectNode2.Attributes["curCode"].InnerText;
                                            stringList.Add(innerText2);
                                        }
                                    }
                                }
                                string str9 = "";
                                if (stringList.Count > 0)
                                {
                                    xmlDocument.Load(filename);
                                    XmlNode documentElement2 = (XmlNode)xmlDocument.DocumentElement;
                                    ((XmlElement)documentElement2.SelectSingleNode("Events/Event")).SetAttribute("Name", str6);
                                    XmlNode xmlNode = documentElement2.SelectSingleNode("Events/Event/DataField");
                                    foreach (string str10 in stringList)
                                    {
                                        XmlElement element = xmlDocument.CreateElement("Data");
                                        element.SetAttribute("Code", str10);
                                        element.SetAttribute("CorpOrderID", billNo);
                                        element.SetAttribute("Actor", str3);
                                        element.SetAttribute("ActDate", str2);
                                        element.SetAttribute("ToCorpID", str7);
                                        xmlNode.AppendChild((XmlNode)element);
                                    }
                                    string withoutExtension = Path.GetFileNameWithoutExtension(str8);

                                    var names = withoutExtension.Split('_');
                                    withoutExtension = string.Join("_", names.Take(names.Length - 1).ToArray().ToArray());
                                    str9 = $"{Path.GetDirectoryName(str8)}\\{outType}_{billNo}_{withoutExtension}_{stringList.Count()}件.xml";
                                    xmlDocument.Save(str9);
                                }
                                if (((IEnumerable<string>)source).Count<string>() == 1)
                                {
                                    int num11 = (int)MessageBox.Show("单个文件转换完成。共出库" + stringList.Count.ToString() + "件！");
                                    Process.Start("explorer.exe", Path.GetDirectoryName(str8));
                                }
                                else
                                {
                                    if (!Directory.Exists(path))
                                        Directory.CreateDirectory(path);
                                    if (!string.IsNullOrEmpty(str9))
                                    {
                                        string destFileName = path + "\\" + Path.GetFileName(str9);
                                        new FileInfo(str9).CopyTo(destFileName, true);
                                    }
                                }
                            }
                            if (((IEnumerable<string>)source).Count<string>() > 1)
                            {
                                int num12 = (int)MessageBox.Show("文件批量转换完成。共转换" + ((IEnumerable<string>)source).Count<string>().ToString() + "个文件！");
                                Process.Start("explorer.exe", Path.GetDirectoryName(path + "\\"));
                            }
                        }
                        this.LoadFile();
                        Cursor.Current = Cursors.Default;
                    }
                }
            }
        }

        private void ManyInOne(string str1, string str2, string str3, string str4, string str5, string[] source)
        {

            Cursor.Current = Cursors.WaitCursor;
            string outType = str5.Split(':')[0];
            string str6 = str5.Split(':')[1];
            string str7 = str1.Split(',')[0];
            string filename = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "OutModel\\out.xml";
            string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "ManyInOne\\" + DateTime.Now.ToString("yyMMddHHmmss");
            List<string> stringList = new List<string>();
            List<string> filePaths = new List<string>();
            foreach (string sourcePath in source)
            {
                string str8 = this.SaveProdFile(outType, str4, sourcePath);
                filePaths.Add(str8);
                XmlDocument xmlDocument = new XmlDocument();
                xmlDocument.Load(str8);
                XmlNode documentElement1 = (XmlNode)xmlDocument.DocumentElement;
                int num10 = documentElement1.SelectSingleNode("Events/Event/Relation").Attributes["cascade"].InnerText.Count<char>((Func<char, bool>)(ch => ch == ':')) + 1;

                foreach (XmlNode selectNode1 in documentElement1.SelectNodes("Events/Event/Relation/Batch"))
                {
                    foreach (XmlNode selectNode2 in selectNode1.SelectNodes("Code"))
                    {
                        string innerText1 = selectNode2.Attributes["packLayer"].InnerText;
                        if (num10.ToString() == innerText1)
                        {
                            string innerText2 = selectNode2.Attributes["curCode"].InnerText;
                            stringList.Add(innerText2);
                        }
                    }
                }
                if (!Directory.Exists(path))
                    Directory.CreateDirectory(path);
                new FileInfo(str8).CopyTo(path + "\\" + Path.GetFileName(str8), true);

            }
            string str9 = "";
            if (stringList.Count > 0)
            {
                XmlDocument xmlDocument = new XmlDocument();
                xmlDocument.Load(filename);
                XmlNode documentElement2 = (XmlNode)xmlDocument.DocumentElement;
                ((XmlElement)documentElement2.SelectSingleNode("Events/Event")).SetAttribute("Name", str6);
                XmlNode xmlNode = documentElement2.SelectSingleNode("Events/Event/DataField");
                foreach (string str10 in stringList)
                {
                    XmlElement element = xmlDocument.CreateElement("Data");
                    element.SetAttribute("Code", str10);
                    element.SetAttribute("CorpOrderID", str4);
                    element.SetAttribute("Actor", str3);
                    element.SetAttribute("ActDate", str2);
                    element.SetAttribute("ToCorpID", str7);
                    xmlNode.AppendChild((XmlNode)element);
                }
                string withoutExtension = "";
                string batchNo = "";
                foreach (var p in filePaths)
                {
                   
                    withoutExtension =  Path.GetFileName(p);
                    var names = withoutExtension.Split('_');
                    withoutExtension = string.Join("_", names.Take(names.Length - 2).ToArray().ToArray());

                    if (!batchNo.Contains(names[2]))
                    {
                        batchNo = batchNo + names[2] + "_";
                    }
                }

                batchNo = batchNo.TrimEnd('_');

                str9 = $"{path}\\{outType}_{str4}_{withoutExtension}_{batchNo}_{stringList.Count()}件.xml";
                xmlDocument.Save(str9);

                foreach (var p in filePaths)
                {
                    var t = $"{Path.GetDirectoryName(p)}\\{ Path.GetFileName(str9)}";
                    new FileInfo(str9).CopyTo(t, true);
                }
               
            }
            int num12 = (int)MessageBox.Show("多合一转换完成。共转换" + ((IEnumerable<string>)source).Count<string>().ToString() + "个文件！");
            Process.Start("explorer.exe", Path.GetDirectoryName(path + "\\"));

            this.LoadFile();
            Cursor.Current = Cursors.Default;
        }

        public string SaveProdFile(string outType, string billNo, string sourcePath)
        {
            string fileName = Path.GetFileName(sourcePath);
            string withoutExtension = Path.GetFileNameWithoutExtension(sourcePath);
            string str = DateTime.Now.ToString("yyMMddHHmmss");
            string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "ProdToOut\\" + outType + "_" + billNo + "_" + withoutExtension + "_" + str;
            string destFileName = path + "\\" + fileName;
            if (!Directory.Exists(path))
                Directory.CreateDirectory(path);
            new FileInfo(sourcePath).CopyTo(destFileName, true);
            return destFileName;
        }

        private void bntQryCus_Click(object sender, EventArgs e)
        {
            string str1 = this.txtQryInfo.Text.Trim();
            List<string> stringList = new List<string>();
            if (this.CusArray == null)
            {
                this.LoadCus();
                if (this.CusArray == null)
                {
                    int num = (int)MessageBox.Show("请先更新客户信息！");
                    return;
                }
            }
            if (string.IsNullOrEmpty(str1))
            {
                stringList = ((IEnumerable<string>)this.CusArray).ToList<string>();
            }
            else
            {
                for (int index = 0; index < ((IEnumerable<string>)this.CusArray).Count<string>(); ++index)
                {
                    string cus = this.CusArray[index];
                    if (cus.Contains(str1))
                        stringList.Add(cus);
                }
            }
            this.dgvCusList.Rows.Clear();
            foreach (string str2 in stringList)
            {
                if (!string.IsNullOrEmpty(str2))
                {
                    string[] strArray = str2.Split(',');
                    int count = this.dgvCusList.Rows.Count;
                    this.dgvCusList.Rows.Insert(count, new DataGridViewRow());
                    this.dgvCusList.Rows[count].Cells[0].Value = (object)(count + 1);
                    this.dgvCusList.Rows[count].Cells[1].Value = (object)strArray[2];
                    this.dgvCusList.Rows[count].Cells[2].Value = (object)strArray[0];
                    this.dgvCusList.Rows[count].Cells[3].Value = (object)strArray[1];
                }
            }
        }

        private void dgvCusList_Click(object sender, EventArgs e)
        {
            if (this.dgvCusList.SelectedRows.Count <= 0)
                return;
            this.lblCusInfo.Text = this.dgvCusList.SelectedRows[0].Cells[1].Value.ToString() + "," + this.dgvCusList.SelectedRows[0].Cells[2].Value.ToString();
        }

        public void LoadFile()
        {
            string[] array = ((IEnumerable<string>)Directory.GetDirectories(AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "ProdToOut")).Select(f => new
            {
                f = f,
                fi = new FileInfo(f)
            }).OrderByDescending(_param1 => _param1.fi.CreationTime).Select(_param1 => _param1.fi.FullName).Take<string>(10).ToArray<string>();
            this.dgvPtOList.Rows.Clear();
            foreach (string path in array)
            {
                string[] source1 = path.Split('\\');
                string[] source2 = source1[((IEnumerable<string>)source1).Count<string>() - 1].Split('_');
                string s = source2[((IEnumerable<string>)source2).Count<string>() - 1];
                string str1 = source2[0];
                string[] files = Directory.GetFiles(path);
                string str2 = "";
                string str3 = "";
                if (((IEnumerable<string>)files).Count<string>() > 0)
                {
                    string fileName = Path.GetFileName(files[0]);
                    if (fileName.Contains("出库_"))
                        str3 = fileName;
                    else
                        str2 = fileName;
                }
                if (((IEnumerable<string>)files).Count<string>() > 1)
                {
                    string fileName = Path.GetFileName(files[1]);
                    if (fileName.Contains("出库_"))
                        str3 = fileName;
                    else
                        str2 = fileName;
                }
                int count = this.dgvPtOList.Rows.Count;
                this.dgvPtOList.Rows.Insert(count, new DataGridViewRow());
                this.dgvPtOList.Rows[count].Cells[0].Value = (object)(count + 1);
                this.dgvPtOList.Rows[count].Cells[1].Value = (object)DateTime.ParseExact(s, "yyMMddHHmmss", (IFormatProvider)CultureInfo.CurrentCulture);
                this.dgvPtOList.Rows[count].Cells[2].Value = (object)str2;
                this.dgvPtOList.Rows[count].Cells[3].Value = (object)str3;
                this.dgvPtOList.Rows[count].Cells[4].Value = (object)path;
                this.dgvPtOList.Rows[count].Cells[5].Value = (object)str1;
            }
        }

        private void dgvPtOList_DoubleClick(object sender, EventArgs e)
        {
            if (this.dgvPtOList.SelectedRows.Count <= 0)
                return;
            Process.Start("explorer.exe", Path.GetDirectoryName(this.dgvPtOList.SelectedRows[0].Cells[4].Value.ToString() + "\\"));
        }

        private void label7_Click(object sender, EventArgs e)
        {
            int num = (int)new Form3().ShowDialog();
        }

        private void cbPL_CheckedChanged(object sender, EventArgs e)
        {
            if (!this.cbPL.Checked || !(this.GetSysPL() != "cbPL"))
            {
                if (this.cbPL.Checked)
                {
                    this.cbDHY.Checked = false;
                }
                return;
            }

            this.cbPL.Checked = false;
            int num = (int)MessageBox.Show("暂未开通批量转换功能，请联系供应商。");

        }

        private void cbDHY_CheckedChanged(object sender, EventArgs e)
        {
            if (!this.cbDHY.Checked || !(this.GetSysDHY() != "cbDHY"))
            {
                if (this.cbDHY.Checked)
                {
                    this.cbPL.Checked = false;
                }
                return;
            }

            this.cbDHY.Checked = false;
            int num = (int)MessageBox.Show("暂未开通多合一转换功能，请联系供应商。");
        }

        //public static string GetSerialNumber()
        //{
        //    List<string> stringList = new List<string>();
        //    try
        //    {
        //        foreach (ManagementBaseObject managementBaseObject in new ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia").Get())
        //        {
        //            string str = managementBaseObject["SerialNumber"].ToString().Trim();
        //            stringList.Add(str);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        stringList.Add("zk");
        //    }
        //    if (stringList.Count == 0)
        //        stringList.Add("zk");
        //    stringList.Sort();
        //    return stringList[0];
        //}

        public string GetSysPL()
        {
            string sysPl = "";
            string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "sys.zk";
            if (!File.Exists(path))
                return sysPl;
            StreamReader streamReader = new StreamReader((Stream)File.Open(path, FileMode.Open), Encoding.GetEncoding("GB2312"));
            string end = streamReader.ReadToEnd();
            streamReader.Close();
            streamReader.Dispose();
            string str = PublicZC.Decode(end).Replace("\r\n", "\n");
            string[] strArray = str.Split('\n');
            if ((strArray[0] == Form4.GetSerialNumber() || strArray[0] == Form4.zc) && str.Contains("cbPL"))
                sysPl = "cbPL";
            return sysPl;
        }

        public string GetSysDHY()
        {
            string sysPl = "";
            string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "sys.zk";
            if (!File.Exists(path))
                return sysPl;
            StreamReader streamReader = new StreamReader((Stream)File.Open(path, FileMode.Open), Encoding.GetEncoding("GB2312"));
            string end = streamReader.ReadToEnd();
            streamReader.Close();
            streamReader.Dispose();
            string str = PublicZC.Decode(end).Replace("\r\n", "\n");
            string[] strArray = str.Split('\n');
            if ((strArray[0] == Form4.GetSerialNumber() || strArray[0] == Form4.zc) && str.Contains("cbDHY"))
                sysPl = "cbDHY";
            return sysPl;
        }

        public string GetSysTime()
        {
            string sysTime = "";
            string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "sys.zk";
            if (!File.Exists(path))
                return sysTime;
            StreamReader streamReader = new StreamReader((Stream)File.Open(path, FileMode.Open), Encoding.GetEncoding("GB2312"));
            string end = streamReader.ReadToEnd();
            streamReader.Close();
            streamReader.Dispose();
            string[] strArray = PublicZC.Decode(end).Replace("\r\n", "\n").Split('\n');
            if (strArray[0] == Form4.GetSerialNumber() || strArray[0] == Form4.zc)
            {
                foreach (string str in strArray)
                {
                    if (str.StartsWith("datetime"))
                    {
                        sysTime = str.Split(':')[1];
                        break;
                    }
                }
            }
            return sysTime;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && this.components != null)
                this.components.Dispose();
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.txtQryInfo = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.bntQryCus = new System.Windows.Forms.Button();
            this.panel1 = new System.Windows.Forms.Panel();
            this.dgvCusList = new System.Windows.Forms.DataGridView();
            this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.CodeNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.CusName = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dName = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.panel3 = new System.Windows.Forms.Panel();
            this.lblCusInfo = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.panel2 = new System.Windows.Forms.Panel();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.label7 = new System.Windows.Forms.Label();
            this.dgvPtOList = new System.Windows.Forms.DataGridView();
            this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.panel4 = new System.Windows.Forms.Panel();
            this.cbDHY = new System.Windows.Forms.CheckBox();
            this.cbbOutType = new System.Windows.Forms.ComboBox();
            this.label9 = new System.Windows.Forms.Label();
            this.cbPL = new System.Windows.Forms.CheckBox();
            this.label8 = new System.Windows.Forms.Label();
            this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
            this.txtProdFilePath = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.SelectFile = new System.Windows.Forms.Button();
            this.txtCorpOrderID = new System.Windows.Forms.TextBox();
            this.label6 = new System.Windows.Forms.Label();
            this.txtActor = new System.Windows.Forms.TextBox();
            this.label5 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.panel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dgvCusList)).BeginInit();
            this.panel3.SuspendLayout();
            this.panel2.SuspendLayout();
            this.groupBox1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dgvPtOList)).BeginInit();
            this.panel4.SuspendLayout();
            this.SuspendLayout();
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(1296, 103);
            this.button1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(84, 35);
            this.button1.TabIndex = 12;
            this.button1.Text = "转换";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // txtQryInfo
            // 
            this.txtQryInfo.Location = new System.Drawing.Point(111, 23);
            this.txtQryInfo.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.txtQryInfo.Name = "txtQryInfo";
            this.txtQryInfo.Size = new System.Drawing.Size(317, 28);
            this.txtQryInfo.TabIndex = 14;
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(12, 26);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(98, 18);
            this.label2.TabIndex = 13;
            this.label2.Text = "客户信息：";
            // 
            // bntQryCus
            // 
            this.bntQryCus.Location = new System.Drawing.Point(449, 22);
            this.bntQryCus.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.bntQryCus.Name = "bntQryCus";
            this.bntQryCus.Size = new System.Drawing.Size(84, 35);
            this.bntQryCus.TabIndex = 15;
            this.bntQryCus.Text = "查询";
            this.bntQryCus.UseVisualStyleBackColor = true;
            this.bntQryCus.Click += new System.EventHandler(this.bntQryCus_Click);
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.dgvCusList);
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(1414, 246);
            this.panel1.TabIndex = 18;
            // 
            // dgvCusList
            // 
            this.dgvCusList.AllowUserToAddRows = false;
            this.dgvCusList.AllowUserToDeleteRows = false;
            this.dgvCusList.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
            this.dgvCusList.BackgroundColor = System.Drawing.Color.Honeydew;
            this.dgvCusList.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.dgvCusList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dgvCusList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.Column1,
            this.CodeNo,
            this.CusName,
            this.dName});
            this.dgvCusList.Dock = System.Windows.Forms.DockStyle.Fill;
            this.dgvCusList.GridColor = System.Drawing.Color.Honeydew;
            this.dgvCusList.Location = new System.Drawing.Point(0, 68);
            this.dgvCusList.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
            this.dgvCusList.MultiSelect = false;
            this.dgvCusList.Name = "dgvCusList";
            this.dgvCusList.ReadOnly = true;
            this.dgvCusList.RowTemplate.Height = 23;
            this.dgvCusList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
            this.dgvCusList.Size = new System.Drawing.Size(1414, 178);
            this.dgvCusList.TabIndex = 22;
            this.dgvCusList.Tag = "dgvStopDevList";
            this.dgvCusList.Click += new System.EventHandler(this.dgvCusList_Click);
            // 
            // Column1
            // 
            this.Column1.FillWeight = 30.79317F;
            this.Column1.HeaderText = "序号";
            this.Column1.Name = "Column1";
            this.Column1.ReadOnly = true;
            // 
            // CodeNo
            // 
            this.CodeNo.FillWeight = 73.92893F;
            this.CodeNo.HeaderText = "编号";
            this.CodeNo.Name = "CodeNo";
            this.CodeNo.ReadOnly = true;
            // 
            // CusName
            // 
            this.CusName.FillWeight = 162.4366F;
            this.CusName.HeaderText = "客户名称";
            this.CusName.Name = "CusName";
            this.CusName.ReadOnly = true;
            // 
            // dName
            // 
            this.dName.FillWeight = 132.8413F;
            this.dName.HeaderText = "名称首字母";
            this.dName.Name = "dName";
            this.dName.ReadOnly = true;
            // 
            // panel3
            // 
            this.panel3.Controls.Add(this.lblCusInfo);
            this.panel3.Controls.Add(this.label3);
            this.panel3.Controls.Add(this.bntQryCus);
            this.panel3.Controls.Add(this.label2);
            this.panel3.Controls.Add(this.txtQryInfo);
            this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel3.Location = new System.Drawing.Point(0, 0);
            this.panel3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.panel3.Name = "panel3";
            this.panel3.Size = new System.Drawing.Size(1414, 68);
            this.panel3.TabIndex = 20;
            // 
            // lblCusInfo
            // 
            this.lblCusInfo.AutoSize = true;
            this.lblCusInfo.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.lblCusInfo.ForeColor = System.Drawing.Color.Red;
            this.lblCusInfo.Location = new System.Drawing.Point(693, 30);
            this.lblCusInfo.Name = "lblCusInfo";
            this.lblCusInfo.Size = new System.Drawing.Size(84, 18);
            this.lblCusInfo.TabIndex = 17;
            this.lblCusInfo.Text = "暂未选择";
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label3.Location = new System.Drawing.Point(560, 30);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(141, 18);
            this.label3.TabIndex = 16;
            this.label3.Text = "已选客户信息：";
            // 
            // panel2
            // 
            this.panel2.Controls.Add(this.groupBox1);
            this.panel2.Controls.Add(this.panel4);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel2.Location = new System.Drawing.Point(0, 246);
            this.panel2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(1414, 630);
            this.panel2.TabIndex = 19;
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.label7);
            this.groupBox1.Controls.Add(this.dgvPtOList);
            this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.groupBox1.Location = new System.Drawing.Point(0, 167);
            this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.groupBox1.Size = new System.Drawing.Size(1414, 463);
            this.groupBox1.TabIndex = 14;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "最近10条";
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.ForeColor = System.Drawing.Color.Red;
            this.label7.Location = new System.Drawing.Point(1333, 2);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(80, 18);
            this.label7.TabIndex = 24;
            this.label7.Text = "历史记录";
            this.label7.Click += new System.EventHandler(this.label7_Click);
            // 
            // dgvPtOList
            // 
            this.dgvPtOList.AllowUserToAddRows = false;
            this.dgvPtOList.AllowUserToDeleteRows = false;
            this.dgvPtOList.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
            this.dgvPtOList.BackgroundColor = System.Drawing.Color.Honeydew;
            this.dgvPtOList.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.dgvPtOList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dgvPtOList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.dataGridViewTextBoxColumn1,
            this.dataGridViewTextBoxColumn2,
            this.dataGridViewTextBoxColumn3,
            this.dataGridViewTextBoxColumn4,
            this.Column2,
            this.Column3});
            this.dgvPtOList.Dock = System.Windows.Forms.DockStyle.Fill;
            this.dgvPtOList.GridColor = System.Drawing.Color.Honeydew;
            this.dgvPtOList.Location = new System.Drawing.Point(3, 25);
            this.dgvPtOList.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
            this.dgvPtOList.MultiSelect = false;
            this.dgvPtOList.Name = "dgvPtOList";
            this.dgvPtOList.ReadOnly = true;
            this.dgvPtOList.RowTemplate.Height = 23;
            this.dgvPtOList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
            this.dgvPtOList.Size = new System.Drawing.Size(1408, 434);
            this.dgvPtOList.TabIndex = 23;
            this.dgvPtOList.Tag = "dgvStopDevList";
            this.dgvPtOList.DoubleClick += new System.EventHandler(this.dgvPtOList_DoubleClick);
            // 
            // dataGridViewTextBoxColumn1
            // 
            this.dataGridViewTextBoxColumn1.FillWeight = 30.79317F;
            this.dataGridViewTextBoxColumn1.HeaderText = "序号";
            this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
            this.dataGridViewTextBoxColumn1.ReadOnly = true;
            // 
            // dataGridViewTextBoxColumn2
            // 
            this.dataGridViewTextBoxColumn2.FillWeight = 73.92893F;
            this.dataGridViewTextBoxColumn2.HeaderText = "时间";
            this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
            this.dataGridViewTextBoxColumn2.ReadOnly = true;
            // 
            // dataGridViewTextBoxColumn3
            // 
            this.dataGridViewTextBoxColumn3.FillWeight = 162.4366F;
            this.dataGridViewTextBoxColumn3.HeaderText = "生产文件";
            this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
            this.dataGridViewTextBoxColumn3.ReadOnly = true;
            // 
            // dataGridViewTextBoxColumn4
            // 
            this.dataGridViewTextBoxColumn4.FillWeight = 132.8413F;
            this.dataGridViewTextBoxColumn4.HeaderText = "出库文件";
            this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
            this.dataGridViewTextBoxColumn4.ReadOnly = true;
            // 
            // Column2
            // 
            this.Column2.HeaderText = "路径";
            this.Column2.Name = "Column2";
            this.Column2.ReadOnly = true;
            this.Column2.Visible = false;
            // 
            // Column3
            // 
            this.Column3.HeaderText = "出库类型";
            this.Column3.Name = "Column3";
            this.Column3.ReadOnly = true;
            // 
            // panel4
            // 
            this.panel4.Controls.Add(this.cbDHY);
            this.panel4.Controls.Add(this.cbbOutType);
            this.panel4.Controls.Add(this.label9);
            this.panel4.Controls.Add(this.cbPL);
            this.panel4.Controls.Add(this.label8);
            this.panel4.Controls.Add(this.dateTimePicker1);
            this.panel4.Controls.Add(this.txtProdFilePath);
            this.panel4.Controls.Add(this.label1);
            this.panel4.Controls.Add(this.SelectFile);
            this.panel4.Controls.Add(this.txtCorpOrderID);
            this.panel4.Controls.Add(this.label6);
            this.panel4.Controls.Add(this.txtActor);
            this.panel4.Controls.Add(this.label5);
            this.panel4.Controls.Add(this.label4);
            this.panel4.Controls.Add(this.button1);
            this.panel4.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel4.Location = new System.Drawing.Point(0, 0);
            this.panel4.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.panel4.Name = "panel4";
            this.panel4.Size = new System.Drawing.Size(1414, 167);
            this.panel4.TabIndex = 13;
            // 
            // cbDHY
            // 
            this.cbDHY.AutoSize = true;
            this.cbDHY.ForeColor = System.Drawing.Color.Red;
            this.cbDHY.Location = new System.Drawing.Point(698, 51);
            this.cbDHY.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.cbDHY.Name = "cbDHY";
            this.cbDHY.Size = new System.Drawing.Size(88, 22);
            this.cbDHY.TabIndex = 28;
            this.cbDHY.Text = "多合一";
            this.cbDHY.UseVisualStyleBackColor = true;
            this.cbDHY.CheckedChanged += new System.EventHandler(this.cbDHY_CheckedChanged);
            // 
            // cbbOutType
            // 
            this.cbbOutType.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
            this.cbbOutType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbbOutType.FormattingEnabled = true;
            this.cbbOutType.ItemHeight = 20;
            this.cbbOutType.Location = new System.Drawing.Point(899, 40);
            this.cbbOutType.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.cbbOutType.Name = "cbbOutType";
            this.cbbOutType.Size = new System.Drawing.Size(364, 26);
            this.cbbOutType.TabIndex = 27;
            this.cbbOutType.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.cbbOutType_DrawItem);
            // 
            // label9
            // 
            this.label9.AutoSize = true;
            this.label9.Location = new System.Drawing.Point(800, 48);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(98, 18);
            this.label9.TabIndex = 26;
            this.label9.Text = "出库类型：";
            // 
            // cbPL
            // 
            this.cbPL.AutoSize = true;
            this.cbPL.ForeColor = System.Drawing.Color.Red;
            this.cbPL.Location = new System.Drawing.Point(620, 51);
            this.cbPL.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.cbPL.Name = "cbPL";
            this.cbPL.Size = new System.Drawing.Size(70, 22);
            this.cbPL.TabIndex = 25;
            this.cbPL.Text = "批量";
            this.cbPL.UseVisualStyleBackColor = true;
            this.cbPL.CheckedChanged += new System.EventHandler(this.cbPL_CheckedChanged);
            // 
            // label8
            // 
            this.label8.BackColor = System.Drawing.SystemColors.ActiveCaption;
            this.label8.Dock = System.Windows.Forms.DockStyle.Top;
            this.label8.Location = new System.Drawing.Point(0, 0);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(1414, 2);
            this.label8.TabIndex = 24;
            // 
            // dateTimePicker1
            // 
            this.dateTimePicker1.CustomFormat = "yyyy-MM-dd HH:mm:ss";
            this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
            this.dateTimePicker1.Location = new System.Drawing.Point(108, 103);
            this.dateTimePicker1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.dateTimePicker1.Name = "dateTimePicker1";
            this.dateTimePicker1.Size = new System.Drawing.Size(260, 28);
            this.dateTimePicker1.TabIndex = 23;
            // 
            // txtProdFilePath
            // 
            this.txtProdFilePath.Location = new System.Drawing.Point(107, 44);
            this.txtProdFilePath.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.txtProdFilePath.Name = "txtProdFilePath";
            this.txtProdFilePath.ReadOnly = true;
            this.txtProdFilePath.Size = new System.Drawing.Size(402, 28);
            this.txtProdFilePath.TabIndex = 22;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(7, 48);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(98, 18);
            this.label1.TabIndex = 21;
            this.label1.Text = "生产文件：";
            // 
            // SelectFile
            // 
            this.SelectFile.Location = new System.Drawing.Point(515, 43);
            this.SelectFile.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.SelectFile.Name = "SelectFile";
            this.SelectFile.Size = new System.Drawing.Size(84, 35);
            this.SelectFile.TabIndex = 20;
            this.SelectFile.Text = "选择";
            this.SelectFile.UseVisualStyleBackColor = true;
            this.SelectFile.Click += new System.EventHandler(this.SelectFile_Click);
            // 
            // txtCorpOrderID
            // 
            this.txtCorpOrderID.Location = new System.Drawing.Point(899, 103);
            this.txtCorpOrderID.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.txtCorpOrderID.Name = "txtCorpOrderID";
            this.txtCorpOrderID.Size = new System.Drawing.Size(364, 28);
            this.txtCorpOrderID.TabIndex = 18;
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(800, 110);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(98, 18);
            this.label6.TabIndex = 17;
            this.label6.Text = "出库单号：";
            // 
            // txtActor
            // 
            this.txtActor.Location = new System.Drawing.Point(484, 103);
            this.txtActor.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.txtActor.Name = "txtActor";
            this.txtActor.Size = new System.Drawing.Size(293, 28);
            this.txtActor.TabIndex = 16;
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(402, 110);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(80, 18);
            this.label5.TabIndex = 15;
            this.label5.Text = "操作人：";
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(8, 107);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(98, 18);
            this.label4.TabIndex = 13;
            this.label4.Text = "出库时间：";
            // 
            // Form2
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(1414, 876);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.panel1);
            this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.MaximizeBox = false;
            this.Name = "Form2";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Form2";
            this.Load += new System.EventHandler(this.Form2_Load);
            this.panel1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.dgvCusList)).EndInit();
            this.panel3.ResumeLayout(false);
            this.panel3.PerformLayout();
            this.panel2.ResumeLayout(false);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dgvPtOList)).EndInit();
            this.panel4.ResumeLayout(false);
            this.panel4.PerformLayout();
            this.ResumeLayout(false);

        }


    }
}
